
import json
import requests


with requests.post("http://127.0.0.1:8000/work",
                   headers={'Accept': 'text/event-stream'},
                   data=json.dumps({
                       'name': 'work',
                       'number': 5
                   }),
                   stream=True) as r:
    for line in r.iter_lines():
        data = json.loads(line.decode('utf-8'))
        print(data)

